package com.itxiuyixiu.tools.qiniuyun;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

/**
 * @author 黄磊
 * @date 2020/4/30
 */
@SuppressWarnings("ConfigurationProperties")
@Order(1)
@Validated
@ConfigurationProperties(prefix = "qiniuyun")
public class QiniuyunProperties {
    @NotEmpty(message = "七牛云的accessKey不能为空")
    private String accessKey;
    @NotEmpty(message = "七牛云的secretKey不能为空")
    private String secretKey;
    @NotEmpty(message = "七牛云的bucket不能为空")
    private String bucket;
    private Integer expireSeconds = 900;

    public String getAccessKey() {
        return accessKey;
    }

    public void setAccessKey(String accessKey) {
        this.accessKey = accessKey;
    }

    public String getSecretKey() {
        return secretKey;
    }

    public void setSecretKey(String secretKey) {
        this.secretKey = secretKey;
    }

    public String getBucket() {
        return bucket;
    }

    public void setBucket(String bucket) {
        this.bucket = bucket;
    }

    public Integer getExpireSeconds() {
        return expireSeconds;
    }

    public void setExpireSeconds(Integer expireSeconds) {
        this.expireSeconds = expireSeconds;
    }
}
